Skip to content

[Fiber] Use ReactDOM.unstable_batchedUpdates in Fiber tests#8263

Merged
gaearon merged 1 commit intofacebook:masterfrom
gaearon:updates-test-fiber
Nov 10, 2016
Merged

[Fiber] Use ReactDOM.unstable_batchedUpdates in Fiber tests#8263
gaearon merged 1 commit intofacebook:masterfrom
gaearon:updates-test-fiber

Conversation

@gaearon
Copy link
Copy Markdown
Collaborator

@gaearon gaearon commented Nov 10, 2016

This fixes some errors due to attempting to use Stack-only ReactUpdates.
It uncovers an interesting bug in Fiber related to batching:

● ReactUpdates › should queue updates from during mount

    Cannot commit the same tree as before. This is probably a bug related to the return field.
      
      at completeUnitOfWork (src/renderers/shared/fiber/ReactFiberScheduler.js:323:17)
      at performUnitOfWork (src/renderers/shared/fiber/ReactFiberScheduler.js:368:14)
      at performTaskWorkUnsafe (src/renderers/shared/fiber/ReactFiberScheduler.js:460:9)
      at performAndHandleErrors (src/renderers/shared/fiber/ReactFiberScheduler.js:492:15)
      at performTaskWork (src/renderers/shared/fiber/ReactFiberScheduler.js:475:5)
      at Object.batchedUpdates (src/renderers/shared/fiber/ReactFiberScheduler.js:789:9)
      at Object.ReactDOM.unstable_batchedUpdates (src/renderers/dom/fiber/ReactDOMFiber.js:169:24)
      at Object.<anonymous> (src/renderers/shared/stack/reconciler/__tests__/ReactUpdates-test.js:774:14)

The failing test is here. It was extracted from #1353, and originally added in #1363.

The interesting part about it is that it's a hard Fiber crash (definitely a bug), and that it only occurs when rendering is wrapped in ReactDOM.unstable_batchedUpdates. See #1363 for more information about this scenario.

@gaearon
Copy link
Copy Markdown
Collaborator Author

gaearon commented Nov 10, 2016

#selfreview because it's just changing to use public API, no other real changes.

@gaearon gaearon deleted the updates-test-fiber branch November 10, 2016 21:29
acusti pushed a commit to brandcast/react that referenced this pull request Mar 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants